package com.lagou.rocket.demo.order.repository;


import com.lagou.rocket.demo.order.model.Order;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Lock;

import javax.persistence.LockModeType;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author KK
 * @since 2021-10-30
 */
public interface OrderRepository extends JpaRepository<Order, Long> {


    @Lock(value = LockModeType.PESSIMISTIC_WRITE)
    Order getOrderById(Long orderId);



}
